with open('test.txt','w',encoding='utf-8') as f:
    buf = f.write('wow,so beautiful!')
    print(buf)